var express = require('express')
var router = express.Router()
var rankIng = require('./../util/app.js')
/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', {
    title: 'Express'
  })
})

router.get('/getInit', function(req, resp, next) {
  let params = req.query
  new Promise((reslove, reject) => {
    reslove(rankIng(params.token))
  }).then(respop => {
    resp.status(200).json({
      code: 1,
      message: '发送完成...',
      pageHtml: respop
    })
  })
})

module.exports = router
